package com.zhuang.factory.simplefactory;

/**
 * @Classname ShapeFactory
 * @Description 简单工厂类
 * @Date 2021/3/18 15:43
 * @Created by dell
 */

public class ShapeFactory {
    public static Shape createShape(String shapeType) {
        if ("Rectangle".equalsIgnoreCase(shapeType)) {
            return new Rectangle();
        }
        if ("Circle".equalsIgnoreCase(shapeType)) {
            return new Circle();
        }
        if ("Square".equalsIgnoreCase(shapeType)) {
            return new Square();
        }
        return null;
    }
}
